/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.grt192.demos;

import com.grt192.core.GRTObject;
import com.grt192.event.SensorChangeListener;
import com.grt192.event.SensorEvent;
import com.grt192.spot.sensor.IDG500Gyro;

/**
 *
 * @author ajc
 */
public class IDG500Demo extends GRTObject implements SensorChangeListener {

    public IDG500Demo() {
        IDG500Gyro g = new IDG500Gyro(1, 2, 3, 21, "gyro");
        g.addSensorChangeListener(this);
        g.start();
        setPrinting(true);
    }

    public void sensorStateChanged(SensorEvent e, String key) {
        String newKey = "Velocity";
        if (key.equals(newKey)) {
            log(newKey + ":" + e.getData(newKey));
        }
    }
}
